package com.gupaowork.pattern.observer;

import java.util.Observable;
import java.util.Observer;

/**
 * @Author heweicheng
 * @Date 2020/10/4
 */
public class Teacher implements Observer {

    private final String name;

    public Teacher(String name){
        this.name = name;
    }
    @Override
    public void update(Observable o, Object arg) {
        GPer gPer = (GPer) o;
        Question question = (Question)arg;
        System.out.println(name + "老师，你好！你收到了来自"+question.getName() +"的提问，内容是："+question.getContent());
    }
}
